package top.leix.springdemo.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;

/**
 * 操作日志表
 * @TableName operate_log
 */
@TableName(value ="operate_log")
@Data
public class OperateLog implements Serializable {
    /**
     * ID
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 操作人账号
     */
    @TableField(value = "operate_user")
    private String operate_user;

    /**
     * 操作时闻
     */
    @TableField(value = "operate_time")
    private Date operate_time;

    /**
     * 操作的类名
     */
    @TableField(value = "class_name")
    private String class_name;

    /**
     * 操作的方法名
     */
    @TableField(value = "method_name")
    private String method_name;

    /**
     * 方法参数
     */
    @TableField(value = "method_params")
    private String method_params;

    /**
     * 返回值
     */
    @TableField(value = "return_value")
    private String return_value;

    /**
     * 方法执行耗时，单位:ms
     */
    @TableField(value = "cost_time")
    private Long cost_time;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        OperateLog other = (OperateLog) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getOperate_user() == null ? other.getOperate_user() == null : this.getOperate_user().equals(other.getOperate_user()))
            && (this.getOperate_time() == null ? other.getOperate_time() == null : this.getOperate_time().equals(other.getOperate_time()))
            && (this.getClass_name() == null ? other.getClass_name() == null : this.getClass_name().equals(other.getClass_name()))
            && (this.getMethod_name() == null ? other.getMethod_name() == null : this.getMethod_name().equals(other.getMethod_name()))
            && (this.getMethod_params() == null ? other.getMethod_params() == null : this.getMethod_params().equals(other.getMethod_params()))
            && (this.getReturn_value() == null ? other.getReturn_value() == null : this.getReturn_value().equals(other.getReturn_value()))
            && (this.getCost_time() == null ? other.getCost_time() == null : this.getCost_time().equals(other.getCost_time()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getOperate_user() == null) ? 0 : getOperate_user().hashCode());
        result = prime * result + ((getOperate_time() == null) ? 0 : getOperate_time().hashCode());
        result = prime * result + ((getClass_name() == null) ? 0 : getClass_name().hashCode());
        result = prime * result + ((getMethod_name() == null) ? 0 : getMethod_name().hashCode());
        result = prime * result + ((getMethod_params() == null) ? 0 : getMethod_params().hashCode());
        result = prime * result + ((getReturn_value() == null) ? 0 : getReturn_value().hashCode());
        result = prime * result + ((getCost_time() == null) ? 0 : getCost_time().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", operate_user=").append(operate_user);
        sb.append(", operate_time=").append(operate_time);
        sb.append(", class_name=").append(class_name);
        sb.append(", method_name=").append(method_name);
        sb.append(", method_params=").append(method_params);
        sb.append(", return_value=").append(return_value);
        sb.append(", cost_time=").append(cost_time);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}